package com.zjuee.base.model.common.basic;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.valid.Update;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 区域信息
 *
 * @author wu liang
 * @since 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@TableName(value = "sys_area")
public class Area implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增ID
     */
    @TableId
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @NotNull(message = "id can't be empty", groups = {Update.class})
    private Long id;

    /**
     * 父ID
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @NotNull(message = "id can't be empty", groups = {Update.class})
    private Long parentId;

    /**
     * 区域名称
     */
    private String areaName;

    /**
     * 纬度
     */
    private BigDecimal lat;

    /**
     * 经度
     */
    private BigDecimal lng;

    /**
     * 层级
     */
    @JSONField(serialize = false)
    private String locationPath;

    /**
     * 有几层级
     */
    private Integer layered;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 自定义层级
     */
    @JSONField(serialize = false)
    private String levelCode;

    /**
     * 区域详情
     */
    private String address;

}
